package com.start.service;

import com.start.domain.Girl;
import com.start.repostiory.GirlRepostiory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by starmayu on 2017/9/25.
 *
 */
@Service
public class GirlService {

    @Autowired
    private GirlRepostiory girlRepostiory;

    @Transactional
    public void insertTwo(){
        Girl girlA = new Girl();
        girlA.setCupSize("A");
        girlA.setAge(11);
        girlRepostiory.save(girlA);

        Girl girlB = new Girl();
        girlB.setCupSize("B");
        girlB.setAge(12);
        girlRepostiory.save(girlB);

    }
}
